import request from '@/utils/request'

// 查询投票详情列表
export function listVoteInfo(query) {
  return request({
    url: '/community/owner/voteInfo/list',
    method: 'get',
    params: query
  })
}

// 查询投票详情详细
export function getVoteInfo(id) {
  return request({
    url: '/community/owner/voteInfo/' + id,
    method: 'get'
  })
}

// 查询投票统计数据
export function getVoteStats(voteId) {
  return request({
    url: '/community/owner/voteInfo/stats/' + voteId,
    method: 'get'
  })
}

// 新增投票详情
export function addVoteInfo(data) {
  return request({
    url: '/community/owner/voteInfo',
    method: 'post',
    data: data
  })
}

// 修改投票详情
export function updateVoteInfo(data) {
  return request({
    url: '/community/owner/voteInfo',
    method: 'put',
    data: data
  })
}

// 删除投票详情
export function delVoteInfo(id) {
  return request({
    url: '/community/owner/voteInfo/' + id,
    method: 'delete'
  })
}

// 导出投票详情
export function exportVoteInfo(query) {
  return request({
    url: '/community/owner/voteInfo/export',
    method: 'get',
    params: query
  })
}
